package menu;

public class TextMenuElement implements MenuElement {
    private final int aID;
    private final char aHotkey;
    private final String aDescription;
    private final String aMenuLink;
    
    public TextMenuElement(int pID, char pHotkey, String pDescription) {
        assert pDescription != null;
        
        aID = pID;
        aHotkey = pHotkey;
        aDescription = pDescription;
        aMenuLink = "";
    }
    
    public TextMenuElement(int pID, char pHotkey, String pDescription, String pMenuLink) {
        assert pDescription != null && pMenuLink != null;
        
        aID = pID;
        aHotkey = pHotkey;
        aDescription = pDescription;
        aMenuLink = pMenuLink;
    }
    
    public boolean matches(char pHotkey) {
        return aHotkey == pHotkey;
    }
    
    public int getID() {
        return aID;
    }
    
    public char getHotkey() {
        return aHotkey;
    }
    
    public String getDescription() {
        return aDescription;
    }
    
    public boolean isLink() {
        return !aMenuLink.equals("");
    }
    
    public String getLink() {
        return aMenuLink;
    }
}
